<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>01_JS回顾</title>
</head>
<body>
<script>
    var a = 10;
    var b = 2.2;
    var c = "hello";
    var d = true;
    var e = false;
    var f = null;
    var g;
    let h = {};
    console.log(a, b, c, d, e, f, g, h,typeof a, typeof b, typeof c, typeof d, typeof e, typeof f, typeof g,typeof h);
    h.like = "过新年";
    console.log(h, typeof h, h.like);
    let arr = [1, true, 'hello'];
    console.log(arr, typeof arr);
    console.log(arr[0], arr[1], arr[2], arr[9]);
    console.log(Number('123'),typeof Number('123'));
    console.log(Number('hello'), typeof Number('hello'));//NaN
    console.log(parseInt('123'), typeof parseInt('123'));
    console.log(String(123), typeof String(123));

    console.log(Boolean(0));//false
    console.log(Boolean(1));//true
    console.log(Boolean(''));//false
    console.log(Boolean('hello'));//true
    console.log(Boolean(null));//false
    console.log(Boolean(undefined));//false
    console.log(Boolean({}));//true
    console.log(Boolean([]));//true
    console.log(Boolean(NaN));//false
    console.log(Boolean(' '));//true
    console.log(Boolean(false));//false

    let x = 1;
    let y = true;
    console.log(x == y);//true
    console.log(x === y);//false
    console.log(x != y);//false
    console.log(3 > 7);//false
    console.log(3 > '7');//false
    console.log('3' < 7);//true
    console.log('3' < '7');//true
    console.log('3'.charCodeAt());
    console.log('7'.charCodeAt());
</script>
</body>
</html>